<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			//var arr = [10,15,2,32,5,4,20,8,48,54,6];找出数组中小于10 的数据，并组成一个新的数组

			var arr = [10, 15, 2, 32, 5, 4, 20, 8, 48, 54, 6];
			var arr1 = [];//用来接收新数组
			var index=0;
			function map(m) {
				for (var i = 0; i < m.length; i++) {
					//判断是否小于10 是则放入新数组
					if(m[i]<10){
						
						arr1[index]=m[i];
						index++
						
					}

				}

				return arr1//返回新数组
			}
			console.log(map(arr))
		</script>
	</body>
</html>
